# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=libretro-bsnes-hd
pkgver=53
pkgrel=1
pkgdesc='Super Nintendo Entertainment System core'
arch=(loong64 x86_64)
url=https://github.com/DerKoun/bsnes-hd
license=(GPL3)
groups=(libretro)
depends=(
  gcc-libs
  libretro-core-info
)
makedepends=(git)
_commit=f46b6d6368ea93943a30b5d4e79e8ed51c2da5e8
source=(
  libretro-bsnes-hd::git+https://github.com/DerKoun/bsnes-hd.git#commit=${_commit}
  libretro-bsnes-hd-flags.patch
)
sha256sums=(
  SKIP
  8108ce3da95d9a7fd9fae00d2db042f1053e60d19fe87813b7ddf0aa5313cdd8
)

prepare() {
  cd libretro-bsnes-hd

  patch -Np1 -i ../libretro-bsnes-hd-flags.patch
}

pkgver() {
  cd libretro-bsnes-hd

  git rev-list --count HEAD
}

build() {
  make -C libretro-bsnes-hd/bsnes -f GNUmakefile target=libretro binary=library local=false platform=linux
}

package() {
  install -Dm 644 libretro-bsnes-hd/bsnes/out/bsnes_hd_beta_libretro.so -t "${pkgdir}"/usr/lib/libretro/
}

# vim: ts=2 sw=2 et:
